package com.ysc.BaoMing;

import com.ysc.IUDS.Bill_Information;
import com.ysc.IUDS.Class_Information;
import com.ysc.IUDS.Student_Information;
import com.ysc.IUDS.Teacher_Information;

import java.util.Scanner;

public class Baoming {
    public static void main(String[] args){

        Scanner in = new Scanner(System.in);
        System.out.println("事先声明：本校课节时间均为2小时，每节课中间有10分数休息，为保证教师能兼顾到每一个学生，每班上课容量最大为10人，望周知！");

        //查看所有教师信息
        Teacher_Information teacherInformation = new Teacher_Information();
        System.out.println("以下是本校的教师信息，请您过目，并根据个人需要选择相应的教师和上课时间：");
        teacherInformation.TeachersShow();


        //选择想上课的教师
        System.out.println("您是否心仪的教师呢？告诉我您的选择：（输入教师编号）");
        Class_Information classInformation = new Class_Information();
        int tid = in.nextInt();
        classInformation.ShowClassesByTid(tid);

        //选择该教师的班级
        System.out.println("以下是该教师的所有课程，您可以选择一个您方便的时间上课：（输入课堂号）");
        int cid = in.nextInt();
        classInformation.ShowClassesByCid(cid);
        int cnum = classInformation.GetCNum(cid);

        //根据班级人数决定是否可以报名
        Confirm confirm = new Confirm();
        confirm.IfSure(cnum);

        //添加学生信息
        Student_Information studentInformation = new Student_Information();
        int Sid = studentInformation.GetTopStid();
        Sid = studentInformation.StudentInsert();

        //添加账单信息
        Bill_Information bill_information = new Bill_Information();
        int price = teacherInformation.GetOncePrice(tid);
        bill_information.InsertBill(Sid, cid, price);

        //修改class表信息
        classInformation.UpdateCNum(cid);

        //开收费清单
        bill_information.CheckBills(Sid,cid);
    }
}
